(0) Obligation:

Clauses:

append(nil, Y, Y).
append(cons(U, V), Y, cons(U, Z)) :- append(V, Y, Z).
lessleaves(nil, cons(W, Z)).
lessleaves(cons(U, V), cons(W, Z)) :- ','(append(U, V, U1), ','(append(W, Z, W1), lessleaves(U1, W1))).

Query: lessleaves(g,g)

(1) PrologToPrologProblemTransformerProof (SOUND transformation)

Built Prolog problem from termination graph ICLP10.

(2) Obligation:

Clauses:

appendA(nil, T29, T29).
appendA(cons(T36, T37), T38, cons(T36, X47)) :- appendA(T37, T38, X47).
pB(T13, T14, X18, T19) :- appendA(T13, T14, X18).
pB(T13, T14, T22, T19) :- ','(appendA(T13, T14, T22), lessleavesC(T19, T22)).
lessleavesC(nil, cons(T5, T6)).
lessleavesC(cons(nil, T19), cons(T13, T14)) :- pB(T13, T14, X18, T19).
lessleavesC(cons(cons(T51, T52), T53), cons(T13, T14)) :- appendA(T52, T53, X68).
lessleavesC(cons(cons(T51, T52), T53), cons(T13, T14)) :- ','(appendA(T52, T53, T56), pB(T13, T14, X18, cons(T51, T56))).

Query: lessleavesC(g,g)

(3) PrologToPiTRSProof (SOUND transformation)

We use the technique of [TOCL09]. With regard to the inferred argument filtering the predicates were used in the following modes:
lessleavesC_in: (b,b)
pB_in: (b,b,f,b)
appendA_in: (b,b,f)
Transforming Prolog into the following Term Rewriting System:
Pi-finite rewrite system:
The TRS R consists of the following rules:

lessleavesC_in_gg(nil, cons(T5, T6)) → lessleavesC_out_gg(nil, cons(T5, T6))
lessleavesC_in_gg(cons(nil, T19), cons(T13, T14)) → U5_gg(T19, T13, T14, pB_in_ggag(T13, T14, X18, T19))
pB_in_ggag(T13, T14, X18, T19) → U2_ggag(T13, T14, X18, T19, appendA_in_gga(T13, T14, X18))
appendA_in_gga(nil, T29, T29) → appendA_out_gga(nil, T29, T29)
appendA_in_gga(cons(T36, T37), T38, cons(T36, X47)) → U1_gga(T36, T37, T38, X47, appendA_in_gga(T37, T38, X47))
U1_gga(T36, T37, T38, X47, appendA_out_gga(T37, T38, X47)) → appendA_out_gga(cons(T36, T37), T38, cons(T36, X47))
U2_ggag(T13, T14, X18, T19, appendA_out_gga(T13, T14, X18)) → pB_out_ggag(T13, T14, X18, T19)
pB_in_ggag(T13, T14, T22, T19) → U3_ggag(T13, T14, T22, T19, appendA_in_gga(T13, T14, T22))
U3_ggag(T13, T14, T22, T19, appendA_out_gga(T13, T14, T22)) → U4_ggag(T13, T14, T22, T19, lessleavesC_in_gg(T19, T22))
lessleavesC_in_gg(cons(cons(T51, T52), T53), cons(T13, T14)) → U6_gg(T51, T52, T53, T13, T14, appendA_in_gga(T52, T53, X68))
U6_gg(T51, T52, T53, T13, T14, appendA_out_gga(T52, T53, X68)) → lessleavesC_out_gg(cons(cons(T51, T52), T53), cons(T13, T14))
lessleavesC_in_gg(cons(cons(T51, T52), T53), cons(T13, T14)) → U7_gg(T51, T52, T53, T13, T14, appendA_in_gga(T52, T53, T56))
U7_gg(T51, T52, T53, T13, T14, appendA_out_gga(T52, T53, T56)) → U8_gg(T51, T52, T53, T13, T14, pB_in_ggag(T13, T14, X18, cons(T51, T56)))
U8_gg(T51, T52, T53, T13, T14, pB_out_ggag(T13, T14, X18, cons(T51, T56))) → lessleavesC_out_gg(cons(cons(T51, T52), T53), cons(T13, T14))
U4_ggag(T13, T14, T22, T19, lessleavesC_out_gg(T19, T22)) → pB_out_ggag(T13, T14, T22, T19)
U5_gg(T19, T13, T14, pB_out_ggag(T13, T14, X18, T19)) → lessleavesC_out_gg(cons(nil, T19), cons(T13, T14))

The argument filtering Pi contains the following mapping:
lessleavesC_in_gg(x1, x2)  =  lessleavesC_in_gg(x1, x2)
nil  =  nil
cons(x1, x2)  =  cons(x1, x2)
lessleavesC_out_gg(x1, x2)  =  lessleavesC_out_gg
U5_gg(x1, x2, x3, x4)  =  U5_gg(x4)
pB_in_ggag(x1, x2, x3, x4)  =  pB_in_ggag(x1, x2, x4)
U2_ggag(x1, x2, x3, x4, x5)  =  U2_ggag(x5)
appendA_in_gga(x1, x2, x3)  =  appendA_in_gga(x1, x2)
appendA_out_gga(x1, x2, x3)  =  appendA_out_gga(x3)
U1_gga(x1, x2, x3, x4, x5)  =  U1_gga(x1, x5)
pB_out_ggag(x1, x2, x3, x4)  =  pB_out_ggag(x3)
U3_ggag(x1, x2, x3, x4, x5)  =  U3_ggag(x4, x5)
U4_ggag(x1, x2, x3, x4, x5)  =  U4_ggag(x3, x5)
U6_gg(x1, x2, x3, x4, x5, x6)  =  U6_gg(x6)
U7_gg(x1, x2, x3, x4, x5, x6)  =  U7_gg(x1, x4, x5, x6)
U8_gg(x1, x2, x3, x4, x5, x6)  =  U8_gg(x6)

Infinitary Constructor Rewriting Termination of PiTRS implies Termination of Prolog

(4) Obligation:

Pi-finite rewrite system:
The TRS R consists of the following rules:

lessleavesC_in_gg(nil, cons(T5, T6)) → lessleavesC_out_gg(nil, cons(T5, T6))
lessleavesC_in_gg(cons(nil, T19), cons(T13, T14)) → U5_gg(T19, T13, T14, pB_in_ggag(T13, T14, X18, T19))
pB_in_ggag(T13, T14, X18, T19) → U2_ggag(T13, T14, X18, T19, appendA_in_gga(T13, T14, X18))
appendA_in_gga(nil, T29, T29) → appendA_out_gga(nil, T29, T29)
appendA_in_gga(cons(T36, T37), T38, cons(T36, X47)) → U1_gga(T36, T37, T38, X47, appendA_in_gga(T37, T38, X47))
U1_gga(T36, T37, T38, X47, appendA_out_gga(T37, T38, X47)) → appendA_out_gga(cons(T36, T37), T38, cons(T36, X47))
U2_ggag(T13, T14, X18, T19, appendA_out_gga(T13, T14, X18)) → pB_out_ggag(T13, T14, X18, T19)
pB_in_ggag(T13, T14, T22, T19) → U3_ggag(T13, T14, T22, T19, appendA_in_gga(T13, T14, T22))
U3_ggag(T13, T14, T22, T19, appendA_out_gga(T13, T14, T22)) → U4_ggag(T13, T14, T22, T19, lessleavesC_in_gg(T19, T22))
lessleavesC_in_gg(cons(cons(T51, T52), T53), cons(T13, T14)) → U6_gg(T51, T52, T53, T13, T14, appendA_in_gga(T52, T53, X68))
U6_gg(T51, T52, T53, T13, T14, appendA_out_gga(T52, T53, X68)) → lessleavesC_out_gg(cons(cons(T51, T52), T53), cons(T13, T14))
lessleavesC_in_gg(cons(cons(T51, T52), T53), cons(T13, T14)) → U7_gg(T51, T52, T53, T13, T14, appendA_in_gga(T52, T53, T56))
U7_gg(T51, T52, T53, T13, T14, appendA_out_gga(T52, T53, T56)) → U8_gg(T51, T52, T53, T13, T14, pB_in_ggag(T13, T14, X18, cons(T51, T56)))
U8_gg(T51, T52, T53, T13, T14, pB_out_ggag(T13, T14, X18, cons(T51, T56))) → lessleavesC_out_gg(cons(cons(T51, T52), T53), cons(T13, T14))
U4_ggag(T13, T14, T22, T19, lessleavesC_out_gg(T19, T22)) → pB_out_ggag(T13, T14, T22, T19)
U5_gg(T19, T13, T14, pB_out_ggag(T13, T14, X18, T19)) → lessleavesC_out_gg(cons(nil, T19), cons(T13, T14))

The argument filtering Pi contains the following mapping:
lessleavesC_in_gg(x1, x2)  =  lessleavesC_in_gg(x1, x2)
nil  =  nil
cons(x1, x2)  =  cons(x1, x2)
lessleavesC_out_gg(x1, x2)  =  lessleavesC_out_gg
U5_gg(x1, x2, x3, x4)  =  U5_gg(x4)
pB_in_ggag(x1, x2, x3, x4)  =  pB_in_ggag(x1, x2, x4)
U2_ggag(x1, x2, x3, x4, x5)  =  U2_ggag(x5)
appendA_in_gga(x1, x2, x3)  =  appendA_in_gga(x1, x2)
appendA_out_gga(x1, x2, x3)  =  appendA_out_gga(x3)
U1_gga(x1, x2, x3, x4, x5)  =  U1_gga(x1, x5)
pB_out_ggag(x1, x2, x3, x4)  =  pB_out_ggag(x3)
U3_ggag(x1, x2, x3, x4, x5)  =  U3_ggag(x4, x5)
U4_ggag(x1, x2, x3, x4, x5)  =  U4_ggag(x3, x5)
U6_gg(x1, x2, x3, x4, x5, x6)  =  U6_gg(x6)
U7_gg(x1, x2, x3, x4, x5, x6)  =  U7_gg(x1, x4, x5, x6)
U8_gg(x1, x2, x3, x4, x5, x6)  =  U8_gg(x6)

(5) DependencyPairsProof (EQUIVALENT transformation)

Using Dependency Pairs [AG00,LOPSTR] we result in the following initial DP problem:
Pi DP problem:
The TRS P consists of the following rules:

LESSLEAVESC_IN_GG(cons(nil, T19), cons(T13, T14)) → U5_GG(T19, T13, T14, pB_in_ggag(T13, T14, X18, T19))
LESSLEAVESC_IN_GG(cons(nil, T19), cons(T13, T14)) → PB_IN_GGAG(T13, T14, X18, T19)
PB_IN_GGAG(T13, T14, X18, T19) → U2_GGAG(T13, T14, X18, T19, appendA_in_gga(T13, T14, X18))
PB_IN_GGAG(T13, T14, X18, T19) → APPENDA_IN_GGA(T13, T14, X18)
APPENDA_IN_GGA(cons(T36, T37), T38, cons(T36, X47)) → U1_GGA(T36, T37, T38, X47, appendA_in_gga(T37, T38, X47))
APPENDA_IN_GGA(cons(T36, T37), T38, cons(T36, X47)) → APPENDA_IN_GGA(T37, T38, X47)
PB_IN_GGAG(T13, T14, T22, T19) → U3_GGAG(T13, T14, T22, T19, appendA_in_gga(T13, T14, T22))
U3_GGAG(T13, T14, T22, T19, appendA_out_gga(T13, T14, T22)) → U4_GGAG(T13, T14, T22, T19, lessleavesC_in_gg(T19, T22))
U3_GGAG(T13, T14, T22, T19, appendA_out_gga(T13, T14, T22)) → LESSLEAVESC_IN_GG(T19, T22)
LESSLEAVESC_IN_GG(cons(cons(T51, T52), T53), cons(T13, T14)) → U6_GG(T51, T52, T53, T13, T14, appendA_in_gga(T52, T53, X68))
LESSLEAVESC_IN_GG(cons(cons(T51, T52), T53), cons(T13, T14)) → APPENDA_IN_GGA(T52, T53, X68)
LESSLEAVESC_IN_GG(cons(cons(T51, T52), T53), cons(T13, T14)) → U7_GG(T51, T52, T53, T13, T14, appendA_in_gga(T52, T53, T56))
U7_GG(T51, T52, T53, T13, T14, appendA_out_gga(T52, T53, T56)) → U8_GG(T51, T52, T53, T13, T14, pB_in_ggag(T13, T14, X18, cons(T51, T56)))
U7_GG(T51, T52, T53, T13, T14, appendA_out_gga(T52, T53, T56)) → PB_IN_GGAG(T13, T14, X18, cons(T51, T56))

The TRS R consists of the following rules:

lessleavesC_in_gg(nil, cons(T5, T6)) → lessleavesC_out_gg(nil, cons(T5, T6))
lessleavesC_in_gg(cons(nil, T19), cons(T13, T14)) → U5_gg(T19, T13, T14, pB_in_ggag(T13, T14, X18, T19))
pB_in_ggag(T13, T14, X18, T19) → U2_ggag(T13, T14, X18, T19, appendA_in_gga(T13, T14, X18))
appendA_in_gga(nil, T29, T29) → appendA_out_gga(nil, T29, T29)
appendA_in_gga(cons(T36, T37), T38, cons(T36, X47)) → U1_gga(T36, T37, T38, X47, appendA_in_gga(T37, T38, X47))
U1_gga(T36, T37, T38, X47, appendA_out_gga(T37, T38, X47)) → appendA_out_gga(cons(T36, T37), T38, cons(T36, X47))
U2_ggag(T13, T14, X18, T19, appendA_out_gga(T13, T14, X18)) → pB_out_ggag(T13, T14, X18, T19)
pB_in_ggag(T13, T14, T22, T19) → U3_ggag(T13, T14, T22, T19, appendA_in_gga(T13, T14, T22))
U3_ggag(T13, T14, T22, T19, appendA_out_gga(T13, T14, T22)) → U4_ggag(T13, T14, T22, T19, lessleavesC_in_gg(T19, T22))
lessleavesC_in_gg(cons(cons(T51, T52), T53), cons(T13, T14)) → U6_gg(T51, T52, T53, T13, T14, appendA_in_gga(T52, T53, X68))
U6_gg(T51, T52, T53, T13, T14, appendA_out_gga(T52, T53, X68)) → lessleavesC_out_gg(cons(cons(T51, T52), T53), cons(T13, T14))
lessleavesC_in_gg(cons(cons(T51, T52), T53), cons(T13, T14)) → U7_gg(T51, T52, T53, T13, T14, appendA_in_gga(T52, T53, T56))
U7_gg(T51, T52, T53, T13, T14, appendA_out_gga(T52, T53, T56)) → U8_gg(T51, T52, T53, T13, T14, pB_in_ggag(T13, T14, X18, cons(T51, T56)))
U8_gg(T51, T52, T53, T13, T14, pB_out_ggag(T13, T14, X18, cons(T51, T56))) → lessleavesC_out_gg(cons(cons(T51, T52), T53), cons(T13, T14))
U4_ggag(T13, T14, T22, T19, lessleavesC_out_gg(T19, T22)) → pB_out_ggag(T13, T14, T22, T19)
U5_gg(T19, T13, T14, pB_out_ggag(T13, T14, X18, T19)) → lessleavesC_out_gg(cons(nil, T19), cons(T13, T14))

The argument filtering Pi contains the following mapping:
lessleavesC_in_gg(x1, x2)  =  lessleavesC_in_gg(x1, x2)
nil  =  nil
cons(x1, x2)  =  cons(x1, x2)
lessleavesC_out_gg(x1, x2)  =  lessleavesC_out_gg
U5_gg(x1, x2, x3, x4)  =  U5_gg(x4)
pB_in_ggag(x1, x2, x3, x4)  =  pB_in_ggag(x1, x2, x4)
U2_ggag(x1, x2, x3, x4, x5)  =  U2_ggag(x5)
appendA_in_gga(x1, x2, x3)  =  appendA_in_gga(x1, x2)
appendA_out_gga(x1, x2, x3)  =  appendA_out_gga(x3)
U1_gga(x1, x2, x3, x4, x5)  =  U1_gga(x1, x5)
pB_out_ggag(x1, x2, x3, x4)  =  pB_out_ggag(x3)
U3_ggag(x1, x2, x3, x4, x5)  =  U3_ggag(x4, x5)
U4_ggag(x1, x2, x3, x4, x5)  =  U4_ggag(x3, x5)
U6_gg(x1, x2, x3, x4, x5, x6)  =  U6_gg(x6)
U7_gg(x1, x2, x3, x4, x5, x6)  =  U7_gg(x1, x4, x5, x6)
U8_gg(x1, x2, x3, x4, x5, x6)  =  U8_gg(x6)
LESSLEAVESC_IN_GG(x1, x2)  =  LESSLEAVESC_IN_GG(x1, x2)
U5_GG(x1, x2, x3, x4)  =  U5_GG(x4)
PB_IN_GGAG(x1, x2, x3, x4)  =  PB_IN_GGAG(x1, x2, x4)
U2_GGAG(x1, x2, x3, x4, x5)  =  U2_GGAG(x5)
APPENDA_IN_GGA(x1, x2, x3)  =  APPENDA_IN_GGA(x1, x2)
U1_GGA(x1, x2, x3, x4, x5)  =  U1_GGA(x1, x5)
U3_GGAG(x1, x2, x3, x4, x5)  =  U3_GGAG(x4, x5)
U4_GGAG(x1, x2, x3, x4, x5)  =  U4_GGAG(x3, x5)
U6_GG(x1, x2, x3, x4, x5, x6)  =  U6_GG(x6)
U7_GG(x1, x2, x3, x4, x5, x6)  =  U7_GG(x1, x4, x5, x6)
U8_GG(x1, x2, x3, x4, x5, x6)  =  U8_GG(x6)

We have to consider all (P,R,Pi)-chains

(6) Obligation:

Pi DP problem:
The TRS P consists of the following rules:

LESSLEAVESC_IN_GG(cons(nil, T19), cons(T13, T14)) → U5_GG(T19, T13, T14, pB_in_ggag(T13, T14, X18, T19))
LESSLEAVESC_IN_GG(cons(nil, T19), cons(T13, T14)) → PB_IN_GGAG(T13, T14, X18, T19)
PB_IN_GGAG(T13, T14, X18, T19) → U2_GGAG(T13, T14, X18, T19, appendA_in_gga(T13, T14, X18))
PB_IN_GGAG(T13, T14, X18, T19) → APPENDA_IN_GGA(T13, T14, X18)
APPENDA_IN_GGA(cons(T36, T37), T38, cons(T36, X47)) → U1_GGA(T36, T37, T38, X47, appendA_in_gga(T37, T38, X47))
APPENDA_IN_GGA(cons(T36, T37), T38, cons(T36, X47)) → APPENDA_IN_GGA(T37, T38, X47)
PB_IN_GGAG(T13, T14, T22, T19) → U3_GGAG(T13, T14, T22, T19, appendA_in_gga(T13, T14, T22))
U3_GGAG(T13, T14, T22, T19, appendA_out_gga(T13, T14, T22)) → U4_GGAG(T13, T14, T22, T19, lessleavesC_in_gg(T19, T22))
U3_GGAG(T13, T14, T22, T19, appendA_out_gga(T13, T14, T22)) → LESSLEAVESC_IN_GG(T19, T22)
LESSLEAVESC_IN_GG(cons(cons(T51, T52), T53), cons(T13, T14)) → U6_GG(T51, T52, T53, T13, T14, appendA_in_gga(T52, T53, X68))
LESSLEAVESC_IN_GG(cons(cons(T51, T52), T53), cons(T13, T14)) → APPENDA_IN_GGA(T52, T53, X68)
LESSLEAVESC_IN_GG(cons(cons(T51, T52), T53), cons(T13, T14)) → U7_GG(T51, T52, T53, T13, T14, appendA_in_gga(T52, T53, T56))
U7_GG(T51, T52, T53, T13, T14, appendA_out_gga(T52, T53, T56)) → U8_GG(T51, T52, T53, T13, T14, pB_in_ggag(T13, T14, X18, cons(T51, T56)))
U7_GG(T51, T52, T53, T13, T14, appendA_out_gga(T52, T53, T56)) → PB_IN_GGAG(T13, T14, X18, cons(T51, T56))

The TRS R consists of the following rules:

lessleavesC_in_gg(nil, cons(T5, T6)) → lessleavesC_out_gg(nil, cons(T5, T6))
lessleavesC_in_gg(cons(nil, T19), cons(T13, T14)) → U5_gg(T19, T13, T14, pB_in_ggag(T13, T14, X18, T19))
pB_in_ggag(T13, T14, X18, T19) → U2_ggag(T13, T14, X18, T19, appendA_in_gga(T13, T14, X18))
appendA_in_gga(nil, T29, T29) → appendA_out_gga(nil, T29, T29)
appendA_in_gga(cons(T36, T37), T38, cons(T36, X47)) → U1_gga(T36, T37, T38, X47, appendA_in_gga(T37, T38, X47))
U1_gga(T36, T37, T38, X47, appendA_out_gga(T37, T38, X47)) → appendA_out_gga(cons(T36, T37), T38, cons(T36, X47))
U2_ggag(T13, T14, X18, T19, appendA_out_gga(T13, T14, X18)) → pB_out_ggag(T13, T14, X18, T19)
pB_in_ggag(T13, T14, T22, T19) → U3_ggag(T13, T14, T22, T19, appendA_in_gga(T13, T14, T22))
U3_ggag(T13, T14, T22, T19, appendA_out_gga(T13, T14, T22)) → U4_ggag(T13, T14, T22, T19, lessleavesC_in_gg(T19, T22))
lessleavesC_in_gg(cons(cons(T51, T52), T53), cons(T13, T14)) → U6_gg(T51, T52, T53, T13, T14, appendA_in_gga(T52, T53, X68))
U6_gg(T51, T52, T53, T13, T14, appendA_out_gga(T52, T53, X68)) → lessleavesC_out_gg(cons(cons(T51, T52), T53), cons(T13, T14))
lessleavesC_in_gg(cons(cons(T51, T52), T53), cons(T13, T14)) → U7_gg(T51, T52, T53, T13, T14, appendA_in_gga(T52, T53, T56))
U7_gg(T51, T52, T53, T13, T14, appendA_out_gga(T52, T53, T56)) → U8_gg(T51, T52, T53, T13, T14, pB_in_ggag(T13, T14, X18, cons(T51, T56)))
U8_gg(T51, T52, T53, T13, T14, pB_out_ggag(T13, T14, X18, cons(T51, T56))) → lessleavesC_out_gg(cons(cons(T51, T52), T53), cons(T13, T14))
U4_ggag(T13, T14, T22, T19, lessleavesC_out_gg(T19, T22)) → pB_out_ggag(T13, T14, T22, T19)
U5_gg(T19, T13, T14, pB_out_ggag(T13, T14, X18, T19)) → lessleavesC_out_gg(cons(nil, T19), cons(T13, T14))

The argument filtering Pi contains the following mapping:
lessleavesC_in_gg(x1, x2)  =  lessleavesC_in_gg(x1, x2)
nil  =  nil
cons(x1, x2)  =  cons(x1, x2)
lessleavesC_out_gg(x1, x2)  =  lessleavesC_out_gg
U5_gg(x1, x2, x3, x4)  =  U5_gg(x4)
pB_in_ggag(x1, x2, x3, x4)  =  pB_in_ggag(x1, x2, x4)
U2_ggag(x1, x2, x3, x4, x5)  =  U2_ggag(x5)
appendA_in_gga(x1, x2, x3)  =  appendA_in_gga(x1, x2)
appendA_out_gga(x1, x2, x3)  =  appendA_out_gga(x3)
U1_gga(x1, x2, x3, x4, x5)  =  U1_gga(x1, x5)
pB_out_ggag(x1, x2, x3, x4)  =  pB_out_ggag(x3)
U3_ggag(x1, x2, x3, x4, x5)  =  U3_ggag(x4, x5)
U4_ggag(x1, x2, x3, x4, x5)  =  U4_ggag(x3, x5)
U6_gg(x1, x2, x3, x4, x5, x6)  =  U6_gg(x6)
U7_gg(x1, x2, x3, x4, x5, x6)  =  U7_gg(x1, x4, x5, x6)
U8_gg(x1, x2, x3, x4, x5, x6)  =  U8_gg(x6)
LESSLEAVESC_IN_GG(x1, x2)  =  LESSLEAVESC_IN_GG(x1, x2)
U5_GG(x1, x2, x3, x4)  =  U5_GG(x4)
PB_IN_GGAG(x1, x2, x3, x4)  =  PB_IN_GGAG(x1, x2, x4)
U2_GGAG(x1, x2, x3, x4, x5)  =  U2_GGAG(x5)
APPENDA_IN_GGA(x1, x2, x3)  =  APPENDA_IN_GGA(x1, x2)
U1_GGA(x1, x2, x3, x4, x5)  =  U1_GGA(x1, x5)
U3_GGAG(x1, x2, x3, x4, x5)  =  U3_GGAG(x4, x5)
U4_GGAG(x1, x2, x3, x4, x5)  =  U4_GGAG(x3, x5)
U6_GG(x1, x2, x3, x4, x5, x6)  =  U6_GG(x6)
U7_GG(x1, x2, x3, x4, x5, x6)  =  U7_GG(x1, x4, x5, x6)
U8_GG(x1, x2, x3, x4, x5, x6)  =  U8_GG(x6)

We have to consider all (P,R,Pi)-chains

(7) DependencyGraphProof (EQUIVALENT transformation)

The approximation of the Dependency Graph [LOPSTR] contains 2 SCCs with 8 less nodes.

(8) Complex Obligation (AND)

(9) Obligation:

Pi DP problem:
The TRS P consists of the following rules:

APPENDA_IN_GGA(cons(T36, T37), T38, cons(T36, X47)) → APPENDA_IN_GGA(T37, T38, X47)

The TRS R consists of the following rules:

lessleavesC_in_gg(nil, cons(T5, T6)) → lessleavesC_out_gg(nil, cons(T5, T6))
lessleavesC_in_gg(cons(nil, T19), cons(T13, T14)) → U5_gg(T19, T13, T14, pB_in_ggag(T13, T14, X18, T19))
pB_in_ggag(T13, T14, X18, T19) → U2_ggag(T13, T14, X18, T19, appendA_in_gga(T13, T14, X18))
appendA_in_gga(nil, T29, T29) → appendA_out_gga(nil, T29, T29)
appendA_in_gga(cons(T36, T37), T38, cons(T36, X47)) → U1_gga(T36, T37, T38, X47, appendA_in_gga(T37, T38, X47))
U1_gga(T36, T37, T38, X47, appendA_out_gga(T37, T38, X47)) → appendA_out_gga(cons(T36, T37), T38, cons(T36, X47))
U2_ggag(T13, T14, X18, T19, appendA_out_gga(T13, T14, X18)) → pB_out_ggag(T13, T14, X18, T19)
pB_in_ggag(T13, T14, T22, T19) → U3_ggag(T13, T14, T22, T19, appendA_in_gga(T13, T14, T22))
U3_ggag(T13, T14, T22, T19, appendA_out_gga(T13, T14, T22)) → U4_ggag(T13, T14, T22, T19, lessleavesC_in_gg(T19, T22))
lessleavesC_in_gg(cons(cons(T51, T52), T53), cons(T13, T14)) → U6_gg(T51, T52, T53, T13, T14, appendA_in_gga(T52, T53, X68))
U6_gg(T51, T52, T53, T13, T14, appendA_out_gga(T52, T53, X68)) → lessleavesC_out_gg(cons(cons(T51, T52), T53), cons(T13, T14))
lessleavesC_in_gg(cons(cons(T51, T52), T53), cons(T13, T14)) → U7_gg(T51, T52, T53, T13, T14, appendA_in_gga(T52, T53, T56))
U7_gg(T51, T52, T53, T13, T14, appendA_out_gga(T52, T53, T56)) → U8_gg(T51, T52, T53, T13, T14, pB_in_ggag(T13, T14, X18, cons(T51, T56)))
U8_gg(T51, T52, T53, T13, T14, pB_out_ggag(T13, T14, X18, cons(T51, T56))) → lessleavesC_out_gg(cons(cons(T51, T52), T53), cons(T13, T14))
U4_ggag(T13, T14, T22, T19, lessleavesC_out_gg(T19, T22)) → pB_out_ggag(T13, T14, T22, T19)
U5_gg(T19, T13, T14, pB_out_ggag(T13, T14, X18, T19)) → lessleavesC_out_gg(cons(nil, T19), cons(T13, T14))

The argument filtering Pi contains the following mapping:
lessleavesC_in_gg(x1, x2)  =  lessleavesC_in_gg(x1, x2)
nil  =  nil
cons(x1, x2)  =  cons(x1, x2)
lessleavesC_out_gg(x1, x2)  =  lessleavesC_out_gg
U5_gg(x1, x2, x3, x4)  =  U5_gg(x4)
pB_in_ggag(x1, x2, x3, x4)  =  pB_in_ggag(x1, x2, x4)
U2_ggag(x1, x2, x3, x4, x5)  =  U2_ggag(x5)
appendA_in_gga(x1, x2, x3)  =  appendA_in_gga(x1, x2)
appendA_out_gga(x1, x2, x3)  =  appendA_out_gga(x3)
U1_gga(x1, x2, x3, x4, x5)  =  U1_gga(x1, x5)
pB_out_ggag(x1, x2, x3, x4)  =  pB_out_ggag(x3)
U3_ggag(x1, x2, x3, x4, x5)  =  U3_ggag(x4, x5)
U4_ggag(x1, x2, x3, x4, x5)  =  U4_ggag(x3, x5)
U6_gg(x1, x2, x3, x4, x5, x6)  =  U6_gg(x6)
U7_gg(x1, x2, x3, x4, x5, x6)  =  U7_gg(x1, x4, x5, x6)
U8_gg(x1, x2, x3, x4, x5, x6)  =  U8_gg(x6)
APPENDA_IN_GGA(x1, x2, x3)  =  APPENDA_IN_GGA(x1, x2)

We have to consider all (P,R,Pi)-chains

(10) UsableRulesProof (EQUIVALENT transformation)

For (infinitary) constructor rewriting [LOPSTR] we can delete all non-usable rules from R.

(11) Obligation:

Pi DP problem:
The TRS P consists of the following rules:

APPENDA_IN_GGA(cons(T36, T37), T38, cons(T36, X47)) → APPENDA_IN_GGA(T37, T38, X47)

R is empty.
The argument filtering Pi contains the following mapping:
cons(x1, x2)  =  cons(x1, x2)
APPENDA_IN_GGA(x1, x2, x3)  =  APPENDA_IN_GGA(x1, x2)

We have to consider all (P,R,Pi)-chains

(12) PiDPToQDPProof (SOUND transformation)

Transforming (infinitary) constructor rewriting Pi-DP problem [LOPSTR] into ordinary QDP problem [LPAR04] by application of Pi.

(13) Obligation:

Q DP problem:
The TRS P consists of the following rules:

APPENDA_IN_GGA(cons(T36, T37), T38) → APPENDA_IN_GGA(T37, T38)

R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.

(14) QDPSizeChangeProof (EQUIVALENT transformation)

By using the subterm criterion [SUBTERM_CRITERION] together with the size-change analysis [AAECC05] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:

  • APPENDA_IN_GGA(cons(T36, T37), T38) → APPENDA_IN_GGA(T37, T38)
    The graph contains the following edges 1 > 1, 2 >= 2

(15) YES

(16) Obligation:

Pi DP problem:
The TRS P consists of the following rules:

LESSLEAVESC_IN_GG(cons(nil, T19), cons(T13, T14)) → PB_IN_GGAG(T13, T14, X18, T19)
PB_IN_GGAG(T13, T14, T22, T19) → U3_GGAG(T13, T14, T22, T19, appendA_in_gga(T13, T14, T22))
U3_GGAG(T13, T14, T22, T19, appendA_out_gga(T13, T14, T22)) → LESSLEAVESC_IN_GG(T19, T22)
LESSLEAVESC_IN_GG(cons(cons(T51, T52), T53), cons(T13, T14)) → U7_GG(T51, T52, T53, T13, T14, appendA_in_gga(T52, T53, T56))
U7_GG(T51, T52, T53, T13, T14, appendA_out_gga(T52, T53, T56)) → PB_IN_GGAG(T13, T14, X18, cons(T51, T56))

The TRS R consists of the following rules:

lessleavesC_in_gg(nil, cons(T5, T6)) → lessleavesC_out_gg(nil, cons(T5, T6))
lessleavesC_in_gg(cons(nil, T19), cons(T13, T14)) → U5_gg(T19, T13, T14, pB_in_ggag(T13, T14, X18, T19))
pB_in_ggag(T13, T14, X18, T19) → U2_ggag(T13, T14, X18, T19, appendA_in_gga(T13, T14, X18))
appendA_in_gga(nil, T29, T29) → appendA_out_gga(nil, T29, T29)
appendA_in_gga(cons(T36, T37), T38, cons(T36, X47)) → U1_gga(T36, T37, T38, X47, appendA_in_gga(T37, T38, X47))
U1_gga(T36, T37, T38, X47, appendA_out_gga(T37, T38, X47)) → appendA_out_gga(cons(T36, T37), T38, cons(T36, X47))
U2_ggag(T13, T14, X18, T19, appendA_out_gga(T13, T14, X18)) → pB_out_ggag(T13, T14, X18, T19)
pB_in_ggag(T13, T14, T22, T19) → U3_ggag(T13, T14, T22, T19, appendA_in_gga(T13, T14, T22))
U3_ggag(T13, T14, T22, T19, appendA_out_gga(T13, T14, T22)) → U4_ggag(T13, T14, T22, T19, lessleavesC_in_gg(T19, T22))
lessleavesC_in_gg(cons(cons(T51, T52), T53), cons(T13, T14)) → U6_gg(T51, T52, T53, T13, T14, appendA_in_gga(T52, T53, X68))
U6_gg(T51, T52, T53, T13, T14, appendA_out_gga(T52, T53, X68)) → lessleavesC_out_gg(cons(cons(T51, T52), T53), cons(T13, T14))
lessleavesC_in_gg(cons(cons(T51, T52), T53), cons(T13, T14)) → U7_gg(T51, T52, T53, T13, T14, appendA_in_gga(T52, T53, T56))
U7_gg(T51, T52, T53, T13, T14, appendA_out_gga(T52, T53, T56)) → U8_gg(T51, T52, T53, T13, T14, pB_in_ggag(T13, T14, X18, cons(T51, T56)))
U8_gg(T51, T52, T53, T13, T14, pB_out_ggag(T13, T14, X18, cons(T51, T56))) → lessleavesC_out_gg(cons(cons(T51, T52), T53), cons(T13, T14))
U4_ggag(T13, T14, T22, T19, lessleavesC_out_gg(T19, T22)) → pB_out_ggag(T13, T14, T22, T19)
U5_gg(T19, T13, T14, pB_out_ggag(T13, T14, X18, T19)) → lessleavesC_out_gg(cons(nil, T19), cons(T13, T14))

The argument filtering Pi contains the following mapping:
lessleavesC_in_gg(x1, x2)  =  lessleavesC_in_gg(x1, x2)
nil  =  nil
cons(x1, x2)  =  cons(x1, x2)
lessleavesC_out_gg(x1, x2)  =  lessleavesC_out_gg
U5_gg(x1, x2, x3, x4)  =  U5_gg(x4)
pB_in_ggag(x1, x2, x3, x4)  =  pB_in_ggag(x1, x2, x4)
U2_ggag(x1, x2, x3, x4, x5)  =  U2_ggag(x5)
appendA_in_gga(x1, x2, x3)  =  appendA_in_gga(x1, x2)
appendA_out_gga(x1, x2, x3)  =  appendA_out_gga(x3)
U1_gga(x1, x2, x3, x4, x5)  =  U1_gga(x1, x5)
pB_out_ggag(x1, x2, x3, x4)  =  pB_out_ggag(x3)
U3_ggag(x1, x2, x3, x4, x5)  =  U3_ggag(x4, x5)
U4_ggag(x1, x2, x3, x4, x5)  =  U4_ggag(x3, x5)
U6_gg(x1, x2, x3, x4, x5, x6)  =  U6_gg(x6)
U7_gg(x1, x2, x3, x4, x5, x6)  =  U7_gg(x1, x4, x5, x6)
U8_gg(x1, x2, x3, x4, x5, x6)  =  U8_gg(x6)
LESSLEAVESC_IN_GG(x1, x2)  =  LESSLEAVESC_IN_GG(x1, x2)
PB_IN_GGAG(x1, x2, x3, x4)  =  PB_IN_GGAG(x1, x2, x4)
U3_GGAG(x1, x2, x3, x4, x5)  =  U3_GGAG(x4, x5)
U7_GG(x1, x2, x3, x4, x5, x6)  =  U7_GG(x1, x4, x5, x6)

We have to consider all (P,R,Pi)-chains

(17) UsableRulesProof (EQUIVALENT transformation)

For (infinitary) constructor rewriting [LOPSTR] we can delete all non-usable rules from R.

(18) Obligation:

Pi DP problem:
The TRS P consists of the following rules:

LESSLEAVESC_IN_GG(cons(nil, T19), cons(T13, T14)) → PB_IN_GGAG(T13, T14, X18, T19)
PB_IN_GGAG(T13, T14, T22, T19) → U3_GGAG(T13, T14, T22, T19, appendA_in_gga(T13, T14, T22))
U3_GGAG(T13, T14, T22, T19, appendA_out_gga(T13, T14, T22)) → LESSLEAVESC_IN_GG(T19, T22)
LESSLEAVESC_IN_GG(cons(cons(T51, T52), T53), cons(T13, T14)) → U7_GG(T51, T52, T53, T13, T14, appendA_in_gga(T52, T53, T56))
U7_GG(T51, T52, T53, T13, T14, appendA_out_gga(T52, T53, T56)) → PB_IN_GGAG(T13, T14, X18, cons(T51, T56))

The TRS R consists of the following rules:

appendA_in_gga(nil, T29, T29) → appendA_out_gga(nil, T29, T29)
appendA_in_gga(cons(T36, T37), T38, cons(T36, X47)) → U1_gga(T36, T37, T38, X47, appendA_in_gga(T37, T38, X47))
U1_gga(T36, T37, T38, X47, appendA_out_gga(T37, T38, X47)) → appendA_out_gga(cons(T36, T37), T38, cons(T36, X47))

The argument filtering Pi contains the following mapping:
nil  =  nil
cons(x1, x2)  =  cons(x1, x2)
appendA_in_gga(x1, x2, x3)  =  appendA_in_gga(x1, x2)
appendA_out_gga(x1, x2, x3)  =  appendA_out_gga(x3)
U1_gga(x1, x2, x3, x4, x5)  =  U1_gga(x1, x5)
LESSLEAVESC_IN_GG(x1, x2)  =  LESSLEAVESC_IN_GG(x1, x2)
PB_IN_GGAG(x1, x2, x3, x4)  =  PB_IN_GGAG(x1, x2, x4)
U3_GGAG(x1, x2, x3, x4, x5)  =  U3_GGAG(x4, x5)
U7_GG(x1, x2, x3, x4, x5, x6)  =  U7_GG(x1, x4, x5, x6)

We have to consider all (P,R,Pi)-chains

(19) PiDPToQDPProof (SOUND transformation)

Transforming (infinitary) constructor rewriting Pi-DP problem [LOPSTR] into ordinary QDP problem [LPAR04] by application of Pi.

(20) Obligation:

Q DP problem:
The TRS P consists of the following rules:

LESSLEAVESC_IN_GG(cons(nil, T19), cons(T13, T14)) → PB_IN_GGAG(T13, T14, T19)
PB_IN_GGAG(T13, T14, T19) → U3_GGAG(T19, appendA_in_gga(T13, T14))
U3_GGAG(T19, appendA_out_gga(T22)) → LESSLEAVESC_IN_GG(T19, T22)
LESSLEAVESC_IN_GG(cons(cons(T51, T52), T53), cons(T13, T14)) → U7_GG(T51, T13, T14, appendA_in_gga(T52, T53))
U7_GG(T51, T13, T14, appendA_out_gga(T56)) → PB_IN_GGAG(T13, T14, cons(T51, T56))

The TRS R consists of the following rules:

appendA_in_gga(nil, T29) → appendA_out_gga(T29)
appendA_in_gga(cons(T36, T37), T38) → U1_gga(T36, appendA_in_gga(T37, T38))
U1_gga(T36, appendA_out_gga(X47)) → appendA_out_gga(cons(T36, X47))

The set Q consists of the following terms:

appendA_in_gga(x0, x1)
U1_gga(x0, x1)

We have to consider all (P,Q,R)-chains.

(21) UsableRulesReductionPairsProof (EQUIVALENT transformation)

By using the usable rules with reduction pair processor [LPAR04] with a polynomial ordering [POLO], all dependency pairs and the corresponding usable rules [FROCOS05] can be oriented non-strictly. All non-usable rules are removed, and those dependency pairs and usable rules that have been oriented strictly or contain non-usable symbols in their left-hand side are removed as well.

The following dependency pairs can be deleted:

LESSLEAVESC_IN_GG(cons(nil, T19), cons(T13, T14)) → PB_IN_GGAG(T13, T14, T19)
The following rules are removed from R:

appendA_in_gga(nil, T29) → appendA_out_gga(T29)
Used ordering: POLO with Polynomial interpretation [POLO]:

POL(LESSLEAVESC_IN_GG(x1, x2)) = x1 + x2   
POL(PB_IN_GGAG(x1, x2, x3)) = x1 + x2 + x3   
POL(U1_gga(x1, x2)) = x1 + x2   
POL(U3_GGAG(x1, x2)) = x1 + x2   
POL(U7_GG(x1, x2, x3, x4)) = x1 + x2 + x3 + x4   
POL(appendA_in_gga(x1, x2)) = x1 + x2   
POL(appendA_out_gga(x1)) = x1   
POL(cons(x1, x2)) = x1 + x2   
POL(nil) = 0   

(22) Obligation:

Q DP problem:
The TRS P consists of the following rules:

PB_IN_GGAG(T13, T14, T19) → U3_GGAG(T19, appendA_in_gga(T13, T14))
U3_GGAG(T19, appendA_out_gga(T22)) → LESSLEAVESC_IN_GG(T19, T22)
LESSLEAVESC_IN_GG(cons(cons(T51, T52), T53), cons(T13, T14)) → U7_GG(T51, T13, T14, appendA_in_gga(T52, T53))
U7_GG(T51, T13, T14, appendA_out_gga(T56)) → PB_IN_GGAG(T13, T14, cons(T51, T56))

The TRS R consists of the following rules:

appendA_in_gga(cons(T36, T37), T38) → U1_gga(T36, appendA_in_gga(T37, T38))
U1_gga(T36, appendA_out_gga(X47)) → appendA_out_gga(cons(T36, X47))

The set Q consists of the following terms:

appendA_in_gga(x0, x1)
U1_gga(x0, x1)

We have to consider all (P,Q,R)-chains.

(23) MRRProof (EQUIVALENT transformation)

By using the rule removal processor [LPAR04] with the following ordering, at least one Dependency Pair or term rewrite system rule of this QDP problem can be strictly oriented.
Strictly oriented dependency pairs:

PB_IN_GGAG(T13, T14, T19) → U3_GGAG(T19, appendA_in_gga(T13, T14))
U3_GGAG(T19, appendA_out_gga(T22)) → LESSLEAVESC_IN_GG(T19, T22)
LESSLEAVESC_IN_GG(cons(cons(T51, T52), T53), cons(T13, T14)) → U7_GG(T51, T13, T14, appendA_in_gga(T52, T53))
U7_GG(T51, T13, T14, appendA_out_gga(T56)) → PB_IN_GGAG(T13, T14, cons(T51, T56))

Strictly oriented rules of the TRS R:

appendA_in_gga(cons(T36, T37), T38) → U1_gga(T36, appendA_in_gga(T37, T38))
U1_gga(T36, appendA_out_gga(X47)) → appendA_out_gga(cons(T36, X47))

Used ordering: Knuth-Bendix order [KBO] with precedence:
appendAingga2 > cons2 > U7GG4 > PBINGGAG3 > U3GGAG2 > LESSLEAVESCINGG2 > U1gga2 > appendAoutgga1

and weight map:

appendA_out_gga_1=1
cons_2=0
U1_gga_2=0
PB_IN_GGAG_3=1
U3_GGAG_2=1
appendA_in_gga_2=0
LESSLEAVESC_IN_GG_2=2
U7_GG_4=0

The variable weight is 1

(24) Obligation:

Q DP problem:
P is empty.
R is empty.
The set Q consists of the following terms:

appendA_in_gga(x0, x1)
U1_gga(x0, x1)

We have to consider all (P,Q,R)-chains.

(25) PisEmptyProof (EQUIVALENT transformation)

The TRS P is empty. Hence, there is no (P,Q,R) chain.

(26) YES